package com.tin.tinpicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tin.tinpicturebackend.model.dto.user.UserQueryRequest;
import com.tin.tinpicturebackend.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tin.tinpicturebackend.model.vo.LoginUserVO;
import com.tin.tinpicturebackend.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author a1
 * @description 针对表【user( 用户 )】的数据库操作Service
 * @createDate 2025-10-30 21:03:00
 */
public interface UserService extends IService<User> {


    long userRegister(String userAccount, String userPassword, String checkPassword);

    String getEncryptPassword(String userPassword);

    LoginUserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);

    LoginUserVO getLoginUserVO(User user);

    UserVO getUserVO(User user);

    List<UserVO> getUserVOList(List<User> userList);

    /*
     * 获取当前登录用户
     * */
    User getLoginUser(HttpServletRequest request);

    /**
     * 用户注销
     *
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);

    /**
     * 获取查询条件
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /**
     * 判断用户是否是管理员
     */
    boolean isAdmin(User user);
}
